<template>
    <div class="toast-box">
        <div class="alert alert-success toast-value" role="alert">
            {{ value }}
        </div>
    </div>
</template>    
<script lang="ts">
import { defineComponent } from 'vue'
export default defineComponent({
    name: 'Toast',
    props: {
        value: {
            type: String,
            default: ''
        },
        duration: {
            type: Number,
            default: 3000
        },
        background: {
            type: String,
            default: '#000'
        },
        color: {
            type: String,
            default: '#fff'
        }
    }
})
</script>

<style>
.toast-box {
    position: fixed;
    width: 100vw;
    height: 100vh;
    top: 10%;
    z-index: 2022;
    text-align: center;
}

.toast-value {
    min-width: 100px;
    padding: 8px 10px;
    border-radius: 4px;
    text-align: center;
    display: inline-block;
    animation: anim 0.5s;
}

@keyframes anim {
    0% {
        opacity: 0;
    }

    100% {
        opacity: 1;
    }
}

.toast-value.reomve {
    animation: reomve 0.5s;
}

@keyframes reomve {
    0% {
        opacity: 1;
    }

    100% {
        opacity: 0;
    }
}
</style>